import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vite.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    host: true,
    proxy: {
      // '/api/proxy/api': {
      //   target: 'https://hiagent.volcenginepaas.com',
      //   changeOrigin: true,
      //   // rewrite: (path) => path.replace(/^\/api/, '/api/proxy/api'),
      // },
      '/api/proxy/api': {
        target: 'http://115.190.15.63:32300',
        changeOrigin: true,
        // rewrite: (path) => path.replace(/^\/api/, '/api/proxy/api'),
      },
      '/api/v1/sts': {
        target: 'https://openspeech.bytedance.com',
        changeOrigin: true,
        // rewrite: (path) => path.replace(/^\/api/, '/api/v1/sts'),
      }
    }
  }
})
